package com.wlyuan.open.translator;

import com.wlyuan.basic.dto.customer.CustomerDetailDTO;
import com.wlyuan.open.basic.vo.OpenCustomerDetailVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author
 * 承运商 OpenDTO -> 业务DTO
 */
public class CustomerTranslator {
    @Mapper(
            uses = {},
            imports = {}
    )
    public interface Translator {


        OpenCustomerDetailVO translate(CustomerDetailDTO source);

        List<OpenCustomerDetailVO> translate(List<CustomerDetailDTO> source);
    }

    private static final Translator TRANSLATOR = Mappers.getMapper(Translator.class);

    public static OpenCustomerDetailVO translate(CustomerDetailDTO source){
        return TRANSLATOR.translate(source);
    }

    public static List<OpenCustomerDetailVO> translate(List<CustomerDetailDTO> source){
        return TRANSLATOR.translate(source);
    }

}
